# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-voluptuous
pkgver=0.14.1
pkgrel=1
pkgdesc="A Python data validation library"
url="https://github.com/alecthomas/voluptuous"
license=('BSD')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-pytest')
source=(https://github.com/alecthomas/voluptuous/archive/refs/tags/$pkgver/$pkgname-$pkgver.tar.gz)
sha512sums=('20d8c242b36e71c4eec7d0d7b638596b4f3762c30f8f1e0a4c0b38a4463f0a4c51279168be35a2e11d4e75428487d447e52218cccc78b61e5bab4ae0c5457120')

build() {
  cd voluptuous-$pkgver
  python setup.py build
}

check() {
  cd voluptuous-$pkgver
  pytest
}

package() {
  cd voluptuous-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 COPYING -t "$pkgdir"/usr/share/licenses/$pkgname/
}
